<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <!-- 避免IE使用兼容模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="renderer" content="webkit">
    <!-- TopJUI框架样式 -->
    <link type="text/css" href="../../topjui/css/topjui.core.min.css" rel="stylesheet">
    <link type="text/css" href="../../topjui/themes/default/topjui.red.css" rel="stylesheet" id="dynamicTheme"/>
    <!-- FontAwesome字体图标 -->
    <link type="text/css" href="../../static/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>
    <!-- layui框架样式 -->
    <link type="text/css" href="../../static/plugins/layui/css/layui.css" rel="stylesheet"/>
    <!-- jQuery相关引用 -->
    <script type="text/javascript" src="../../static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="../../static/plugins/jquery/jquery.cookie.js"></script>
    <!-- TopJUI框架配置 -->
    <script type="text/javascript" src="../../static/public/js/topjui.config.js"></script>
    <!-- TopJUI框架核心-->
    <script type="text/javascript" src="../../topjui/js/topjui.core.min.js"></script>
    <!-- TopJUI中文支持 -->
    <script type="text/javascript" src="../../topjui/js/locale/topjui.lang.zh_CN.js"></script>
    <!-- layui框架js -->
    <script type="text/javascript" src="../../static/plugins/layui/layui.js" charset="utf-8"></script>
</head>

<body>
<table class="editTable">
    <tr>
        <td colspan="4">
            <div class="divider">
                <span>使用标签实现</span>
            </div>
        </td>
    </tr>
    <tr>
        <td class="label">组织机构</td>
        <td>
            <input name="org" data-toggle="topjui-combotreegrid"
                   data-options="width:450,
                   labelPosition:'top',
                   url:remoteHost+'/system/organization/getListByCodeSetIdAndLevelId?codeSetId=A&levelId=1',
                   expandUrl:remoteHost+'/system/organization/getListByPid?pid={id}',
                   idField:'id',
                   treeField:'text',
                   columns:[[
                       {field:'text',title:'机构名称'},
                       {field:'leader',title:'负责人'},
                       {field:'levelId',title:'层级',width:100}
                   ]]">
        </td>
    </tr>
    <tr>
        <td colspan="4">
            <div class="divider">
                <span>使用Javascript实现</span>
            </div>
        </td>
    </tr>
    <tr>
        <td class="label">组织机构</td>
        <td>
            <input type="text" id="org2" name="org2">
        </td>
    </tr>
</table>

<script>
    $(function () {
        $('#org2').iCombotreegrid({
            width: 450,
            labelPosition: 'top',
            url: remoteHost + '/system/organization/getListByCodeSetIdAndLevelId?codeSetId=A&levelId=1',
            expandUrl: remoteHost + '/system/organization/getListByPid?pid={id}',
            idField: 'id',
            treeField: 'text',
            columns: [[
                {field: 'text', title: '机构名称'},
                {field: 'leader', title: '负责人'},
                {field: 'levelId', title: '层级', width: 100}
            ]]
        });
    });
</script>
</body>
</html>